Programming the Raspberry Pi by Simon Monk

Programming the Raspberry Pi by Simon Monk

Author:Simon Monk
Language: eng
Format: epub
Publisher: McGraw-Hill Education
Published: 2021-07-15T00:00:00+00:00


Internet

As well as being full of web pages, the Internet is also a source of information for your programs rather than for viewing in a browser. Such web services are available for pretty much everything from currency rates and stock prices to weather forecasts. The software on the server for such web service is called an API (Application Programming Interface) and APIs generally use JSON as a way of communicating with your programs.

As an example of this, we are going to use a weather web service called weatherstack.com. In line with many such web services, you can use the web service for free as long as you don’t make too many demands on it. However, you do normally have to register and make an account. weatherstack is no exception, so, to try out this example, you will need to register for an account at https://weatherstack.com/.

Not unreasonably, weatherstack likes to know who’s using its API and so to access it from your programs you need to include your own personal key with each web request. Once you have registered, you can find your weatherstack key by clicking on the Dashboard button (Figure 6-3).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.